<template>
    <div class="add-form f-c">
      <div class="header">
        <div class="title">
          企业端添加
        </div>
        <el-button @click="$router.go(-1)">返回</el-button>
      </div>
      <div class="add-form-content f-g">
        <SubmitForm
          :rule-form="ruleForm"
          :rules="rules"
          :form-list="formList"
          @close="$router.go(-1)"
          @save="onSave"
        />
      </div>
    </div>
  </template>
  
  <script>
  import { http } from '@/api'
  import { Investor } from '@/dict'
  export default {
    name: 'FormAdd',
    data() {
      return {
        dialogValue: false,
        ruleForm: {
        },
        rules: {
            enterpriseName: [{ required: true, message: '不能为空' }],
            enterpriseType: [{ required: true, message: '不能为空' }],
            enterpriseDirector: [{ required: true, message: '不能为空' }],
            enterprisePhone: [{ required: true, message: '不能为空' }],
            orgCode: [{ required: true, message: '不能为空' }]
        },
        formList: [
          {
            key: 'enterpriseName',
            name: 'input',
            label: '公司名称',
            colSpan: 12
          },
          {
            key: 'enterpriseType',
            name: 'input',
            label: '公司类型',
            colSpan: 12
          },
          {
            key: 'enterpriseDirector',
            name: 'input',
            label: '企业负责人',
            colSpan: 12,
          },
          {
            key: 'enterprisePhone',
            name: 'input',
            label: '企业负责人电话',
            colSpan: 12
          },
          {
            key: 'orgCode',
            name: 'select',
            label: '单位',
            options:[
              {name: '管理端', value: 'A01' },
              {name: '发改端', value: 'A01A02' },
              {name: '单位端', value: 'A01A03' },
              {name: '企业端', value: 'A01A04' },
              {name: '资规端', value: 'A01A05' },
              {name: '代办中心', value: 'A01A06' },
              {name: '专家端', value: 'A01A07' },
            ],
            colSpan: 24
          }
        ]
      }
    },
    created() {
  
    },
    methods: {
      onPageBack() {
        this.$router.back()
      },
      onSave() {
        http.enterprise.createself({ ...this.ruleForm }).then(res => {
          this.$message.success(res.msg)
          this.onPageBack()
        })
      }
    }
  }
  </script>
  
  <style scoped lang="scss">
  </style>
  